<template>
  <div>
    <div class="digui" v-for="item in data" :key="item.id">
      {{ item.type }}
      <!-- 组件递归 -->
      <dgzj :data="item.children" v-if="item.children" />
    </div>
  </div>
</template>

<script>
export default {
  props: ["data"],
  // 定义组件的名字
  name: "dgzj",
};
</script>

<style lang="css" scoped>
.digui {
  padding-left: 120px;
}
</style>